I'm trying to read utf-16 using stdio function fgetws(), but it is only assigning a single byte to each variable in the wchar_t string.
Anyone know whats happening? Cheers.
I'm trying to read utf-16 using stdio function fgetws(), but it is only assigning a single byte to each variable in the wchar_t string.
Anyone know whats happening? Cheers.
When not in binary mode, fgetws() reads a single-byte encoding and converts into a whcar_t encoding (UTF16LE on windows, or UTF/UCS-32 LE/BE on *nix).
If you know how the file is encoded, then open and read the file in binary mode.
gg